package com.example.administrator.baikangxing.fragment;


import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.example.administrator.baikangxing.Dao.OperateData;
import com.example.administrator.baikangxing.R;
import com.example.administrator.baikangxing.activity.LoginActivity;

/**
 * A simple {@link Fragment} subclass.
 */
public class SplashThreeFragment extends Fragment implements View.OnClickListener {


    private Button splash_bt_enter;

    public SplashThreeFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_splash_three, container, false);
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        splash_bt_enter = (Button) view.findViewById(R.id.splash_bt_enter);
        splash_bt_enter.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.splash_bt_enter:
                OperateData.saveIntData(getActivity(),"guide_state",1);
                startActivity(new Intent(getActivity(), LoginActivity.class));
                getActivity().finish();
                break;
        }
    }
}
